#ifndef _CuspFilter_H
#define _CuspFilter_H
#include <iostream>
#include <vector>
#include <assert.h>
#include <math.h>
#include <opencv2/opencv.hpp>
#include "DataStruct.h"

using namespace std;

class CuspFilter
{
public:
	CuspFilter();
	void setFilter(int Num,int threshold);
	~CuspFilter();
	
	void buffClear();
	
	void filter(DataStruct &ture_data,DataStruct &send_data);
	
private:
	//滤波数据
	vector<DataStruct> dataBuff;
	
	//滤波记录的数据数
	int N;
	int threshold_X,mid_X;
	int threshold_Z,mid_Z;;
	//临时储存的数据
	DataStruct temp_data;
	//临时数据是否初始化
	bool temp_data_state;
	bool target_out;
	bool target_lose;
	int count_frame_out;
	int count_frame_lose;
};
#endif
